from csagent.core.node.base_node import BaseNode
from csagent.core.context import AgentState
import time
class Node(BaseNode):
    def initialize(self):
        """初始化节点"""
        print(self.conf)
        print('user feature Node初始化成功')
    def execute(self, state: AgentState, stream_writer=None) -> AgentState:
        print(f"[用户画像]user feature node开始执行")
        query = state['messages'][-1]['content']
        print(f"[用户画像]query:{query}")
        print("[用户画像]画像生成中")
        time.sleep(1)
        state['node_context']['user_feature'] = "用户画像"
        print(f"[用户画像]user feature node执行完成")
        return state